package com.finance.system.export;

import com.finance.framework.lang.BeanUtils;
import com.finance.system.bean.pojo.User;
import com.finance.util.export.ExportBeanParse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.reflect.InvocationTargetException;

/**
 * Created by gyw on 2017/4/10.
 */
public class UserParse extends ExportBeanParse<User, UserImportTemplateBean> {
    Logger logger = LoggerFactory.getLogger(UserParse.class);

    @Override
    protected UserImportTemplateBean parse(User user) {
        UserImportTemplateBean bean = new UserImportTemplateBean();
        try {
            BeanUtils.copyProperties(bean,user);
        } catch (IllegalAccessException e) {
            logger.error(e.getMessage(),e);
        } catch (InvocationTargetException e) {
            logger.error(e.getMessage(),e);
        }
        return bean;
    }
}
